package com.mall.seckill_mall.utils;

import org.springframework.util.DigestUtils;

public class MD5Util {

	private static final String MD5_SALT = "a1*2k#jd";

	public static String getMD5(String str) {
		String base = str.concat(MD5_SALT);
		return DigestUtils.md5DigestAsHex(base.getBytes());
	}

	public static String getMD5(String str, String salt) {
		String base = str.concat(salt);
		return DigestUtils.md5DigestAsHex(base.getBytes());
	}
}
